import 'package:basic_library/src/widgets/view/common_see_image_view.dart';
import 'package:flutter/material.dart';

///
/// 预览图片 - 含下载
///
class QSeeImageAlert extends Dialog {
  final BuildContext buildContext;
  final List<String> imageList;
  final Function(int) downLoad;

  const QSeeImageAlert({
    Key? key,
    required this.buildContext,
    required this.imageList,
    required this.downLoad,
  }) : super(key: key);

  /// 取消对话框
  static hide(BuildContext context) {
    Navigator.of(context).pop();
  }

  /// 显示对话框
  void show() {
    showDialog(
      context: buildContext,
      barrierDismissible: false,
      useSafeArea: false,
      builder: (BuildContext context) {
        return CommonImageView(
          imageList: imageList,
          downLoad: downLoad,
        );
      },
    );
  }
}
